﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Hotnet.Web.Utility.PaginateHelper>" %>

<div class="tac" id="paginate">
    <div class="fr">
        <div class="m5 fl" style=" color:Black; margin-top:6px;">共<span style="color:Red;"><%=Model.TotalCount %></span>条&nbsp; 第<span style="color:Red;">
        <%=Model.TotalCount==0?0:Model.PageNo + 1%></span>/<%=Model.TotalPages %>页</div>
        <%if (Model.PageNo >= Model.PixCount + 1){%>
            <a class="dbk fl b1 pt3 m3 blik black" style='width:55px; height:15px; text-decoration:none;'href='<%=Model.Url+"pageNo=0" %>' >第一页</a>
        <%} %>

        <%if (Model.HasPreviousPage){%>
            <a class="dbk fl b1 pt3 m3 blik black" style='width:55px; height:15px; text-decoration:none;'href='<%=Model.Url+"pageNo="+(Model.PageNo-1) %>' >上一页</a>
        <%} %>

        <%if (Model.PageNo < Model.PixCount)
          {%>
	          <%for (int i = 0; i < Model.PixCount + 1 && i < Model.TotalPages; i++)
             {%>
		        <a class="dbk fl b1 pt3 blik <%= Model.PageNo==i?"red":"black" %>" style='width:20px;<%= Model.PageNo==i?"color:white;":"" %> height:15px; margin:3px 1px; text-decoration:none;'href='<%=Model.Url+"pageNo="+i %>' ><%=i + 1%></a>
	          <%}%>
        <%}
          else
          {%>
	          <%for (int i = Model.PixCount; i > 0; i--)
             {%>
		        <a class="dbk fl b1 pt3 m3 blik" style='width:20px; height:15px;'href='<%=Model.Url+"pageNo="+-(i-Model.PageNo) %>' ><%=-(i - Model.PageNo) + 1%></a>
	          <%}%>
	          <a class="dbk fl b1 pt3 m3" style='width:20px; height:15px;color:red' href='<%=Model.Url+"pageNo=" + Model.PageNo %>' ><%=Model.PageNo + 1%></a>
	          <%for (int i = Model.PageNo + 1; i < Model.TotalPages && i < Model.PageNo + Model.PixCount + 1; i++)
             {%>
		        <a class="dbk fl b1 pt3 m3 blik" style='width:20px; height:15px;'href='<%=Model.Url+"pageNo="+i %>' ><%=i + 1%></a>
	          <%}%>
          <%} %>
          
          <%if (Model.HasNextPage)
            {%>
            <a class="dbk fl b1 pt3 m3 blik black" style='width:55px; height:15px; text-decoration:none;'href='<%=Model.Url+"pageNo=" + (Model.PageNo + 1) %>' >下一页</a>
          <%}%>
          
          <%if (Model.PageNo + Model.PixCount + 1 < Model.TotalPages)
            {%>
            <a class="dbk fl b1 pt3 m3 blik black" style='width:55px; height:15px; text-decoration:none;'href='<%=Model.Url+"pageNo=" + (Model.TotalPages - 1) %>' >最后一页</a>
          <%} %>

        <div class="cb"></div>
    </div>
    <div class="cb"></div>
</div>

<style type="text/css">
	#paginate a:hover
	{
		color:white;
		font-weight:bold;
		border-color:Red;
		background-color:red;
	}
	a.visited
	{
		color:Black;
	}
	.black
	{
		color:Black;
	}
	.red
	{
		color:white;
		background-color:Red;
		border-color:Red;
		font-weight:bold;
	}


</style>

